/**
 * @description 页面加载
 * @param fn {Promise} promise
 * @param options {Object} 加载参数
 */
export default async function(fn, options = {}) {
	const defaultOptions = {
		mask: true,
		title: "加载中..."
	}
	const mergeOptions = Object.assign(defaultOptions, options);
	console.log(mergeOptions);
	uni.showLoading({
		...mergeOptions
	});
	try {
		await fn();
		uni.hideLoading();
	} catch (err) {
		uni.hideLoading();
	}
}